<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class IndexController extends CI_Controller {

	/**
	 * Index Page for this controller.fgf
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function __construct()
        {	parent::__construct();
            //$this->load->model(IndexModel);
            //$this->load->model('MenuModel');
	} 
	public function index()
	{   //$this->load->model('IndexModel');
		   $dados = array(
                'titulo' => 'Index',
                'pagina' => 'principal',
            	//'conta' => $this->PrincipalModel->buscaPai()->result(),
            	'materia' => $this->IndexModel->buscaMateriaCategoria(1,3,2)->result(),
            	'materiaB' => $this->IndexModel->buscaMateriaCategoria(2,3,2)->result(),
            	'materiaP' => $this->IndexModel->buscaMateriaCategoria(3,3,2)->result(),
            	'materiaG' => $this->IndexModel->buscaMateriaCategoria(6,3,0)->result(),
            	'materiaG2' => $this->IndexModel->buscaMateriaCategoria(6,3,3)->result(),
            	'materiaMundo' => $this->IndexModel->buscaMateriaCategoria(1,1,1)->row(),
            	'materiaBrasil' => $this->IndexModel->buscaMateriaCategoria(2,1,1)->row(),
            	'materiaParaiba' => $this->IndexModel->buscaMateriaCategoria(3,1,1)->row(),
            	'materiaEntenda' => $this->IndexModel->buscaMateriaCategoria(11,1,1)->row(),
            	'materiaCuriosidade' => $this->IndexModel->buscaMateriaCategoria(12,1,1)->row(),
            	'imagemCarrossel' => $this->IndexModel->buscaImagemCarrossel()->result(),
            	'maisAcessado' => $this->IndexModel->buscaMaisAcessado()->result(),
            	'tag' => $this->IndexModel->buscaTags()->result(),
            	'evento'=>$this->IndexModel->buscaMateriaCategoria(28,5,0)->result(),
            	'especial' => $this->IndexModel->buscaMateriaCategoria(29,1,0)->row(),
            	
            );		 
            $this->load->view('indexView',$dados);		
        
	}
	public function teste()
        {   	 $dados = array(
                'titulo' => 'Index',
                'pagina' => 'assunto',
            	'a' => $this->IndexModel->teste()->result()
                );
        $this->load->view('indexView',$dados);		
        
                
        }


        public function assunto() 
	{  		 $dados = array(
                'titulo' => 'Index',
                'pagina' => 'assunto',
            	//'conta' => $this->PrincipalModel->buscaPai()->result(),
            	'materia' => $this->IndexModel->buscaMateriaCategoria(1,3,2)->result(),
            	'materiaB' => $this->IndexModel->buscaMateriaCategoria(2,3,2)->result(),
            	'materiaP' => $this->IndexModel->buscaMateriaCategoria(3,3,2)->result(),
            	'materiaG' => $this->IndexModel->buscaMateriaCategoria(6,3,0)->result(),
            	'materiaG2' => $this->IndexModel->buscaMateriaCategoria(6,3,3)->result(),
            	'materiaMundo' => $this->IndexModel->buscaMateriaCategoria(1,1,1)->row(),
            	'materiaBrasil' => $this->IndexModel->buscaMateriaCategoria(2,1,1)->row(),
            	'materiaParaiba' => $this->IndexModel->buscaMateriaCategoria(3,1,1)->row(),
            	'materiaEntenda' => $this->IndexModel->buscaMateriaCategoria(11,1,1)->row(),
            	'materiaCuriosidade' => $this->IndexModel->buscaMateriaCategoria(12,1,1)->row(),
            	'imagemCarrossel' => $this->IndexModel->buscaImagemCarrossel()->result(),
            	'maisAcessado' => $this->IndexModel->buscaMaisAcessado()->result(),
            	'tag' => $this->IndexModel->buscaTags()->result(),
            	'evento'=>$this->IndexModel->buscaMateriaCategoria(28,5,0)->result(),
            	'especial' => $this->IndexModel->buscaMateriaCategoria(29,1,0)->row(),
            	
            );		 
            $this->load->view('indexView',$dados);	
	}

}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */